{include file="public/public"}
<style type="text/css">
	.content_ssft ul li {
		margin: 0 0 100px 40px;
	}
	.content_ssft ul li a{
		background: none;
	}
	.content_ssft ul li p{
		background:url(__PUBLIC__/images/ssfa_lvbg_off.jpg);
	}
</style>
<div class="layui-tab layui-tab-brief" lay-filter="demoTitle">
    <div class="layui-body layui-tab-content site-demo site-demo-body">
        <div class="layui-tab-item layui-show">
            <div class="layui-main">
                <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
                </fieldset>
                <span class="layui-breadcrumb">
                    <a href="__APP__/{$menuConfigArry['functionMod']}/{$menuConfigArry['menuLabel']}">{$menuConfigArry['pmenuName']}</a>
                    <a><cite>{$menuConfigArry['menuName']}</cite></a>
                </span>
                <hr>

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">按酒店：</label>
                        <div class="layui-input-inline">
                            <input id='sourname'  name="text2" type="text" autocomplete="off" class="layui-input">
                        </div>
                        <a href="#" onClick="sousuofangjian()" class="layui-btn ">搜索</a>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">统计数据：</label>
                        <div class="layui-input-inline">
                            <input id='soumonth'  name="text2" type="text" autocomplete="off" class="layui-input">
                        </div>
                        <a href="#" onClick="expotrData()" class="layui-btn ">导出</a>
                    </div>
                </div>


                <div class="content_ssft">

                    <ul style="width:800px;">
                        <?
                     if($roomArr){
                      foreach($roomArr as $val){
                        $timenow=time();
                        $tmp = addslashes(json_encode($val));
                        $timeDevice=$val[stime];
                        if(($timenow-$timeDevice)>900){
                                $rstate=1;
                                }else if($val['vpnstate']==1){
                                $rstate=2;
                                }else{
                                $rstate=0;
                                }
                                if($rstate==1){
                        ?>
                        <li style="float:left;">
                            <a href="#" class="layui-btn layui-btn-sm"onclick='showclick("{$tmp}")'>
                                <img src="__PUBLIC__/images/fangzi.png"  style="margin-left: 12px;"/><p class="ssft_cbg_offline">{$val[hotel]}</p></a>
                        </li>
                        <?php
                        }else if($rstate==2){
                    ?>
                        <li style="float:left;">
                            <a href="#" class="layui-btn layui-btn-sm"onclick='showclick("{$tmp}")'>
                                <!--  <img src="__PUBLIC__/images/fangzi.png"style="margin-left: 12px;" /><p class="ssft_lvbg">{$val[hotel]}</p></a> -->
                                <img src="__PUBLIC__/images/fangzi.png"  style="margin-left: 12px;"/><p class="ssft_cbg_offvpn">{$val[hotel]}</p></a>
                        </li>
                        <?
                        }else{
                    ?>
                        <li style="float:left;">
                            <a href="#" class="layui-btn layui-btn-sm"onclick='showclick("{$tmp}")'>
                                <!-- <img src="__PUBLIC__/images/fangzi.png"style="margin-left: 12px;" /><p class="ssft_lvbg">{$val[hotel]}</p></a> -->
                                <img src="__PUBLIC__/images/fangzi.png"  style="margin-left: 12px;"/><p class="ssft_lvbg">{$val[hotel]}</p></a>
                        </li>
                        <?php
                        }
                    }
                }?>
                    </ul>

                </div>

                <div class="blank"></div>
                <div class="layui-box layui-laypage layui-laypage-default">{$page}</div>

                <div class="content_zh">
                    <ul id='color_box'>
                        <li><img src="__PUBLIC__/images/ssfa_cbg5.jpg" align="absmiddle">=掉线</li>
                        <li><img src="__PUBLIC__/images/ssfa_cbg6.jpg" align="absmiddle">=VPN断线</li>
                        <li><img src="__PUBLIC__/images/ssfa_lvbg.jpg" align="absmiddle">=未断线</li>
                    </ul>
                </div>
                <div class="content_zh">
                    <!--<ul>&lt;!&ndash;-->
                    <!--<li><img src="__PUBLIC__/images/ssfa_bg.jpg" align="absmiddle">=客人外出</li>-->
                    <!--&ndash;&gt;<li><img src="__PUBLIC__/images/ssfa_lvbg.jpg" align="absmiddle">=客人在房内</li>-->
                    <!--<li><img src="__PUBLIC__/images/ssfa_cbg1.jpg" align="absmiddle">=客人在房内(已点播)</li>-->
                    <!--<li><img src="__PUBLIC__/images/ssfa_cbg.jpg" align="absmiddle">=尚未开房</li>-->
                    <!--</ul>-->
                </div>

                <div id="show" style="DISPLAY:none" class="show">
                    <table class="layui-table" lay-skin="line">
                       <thead >
                        <tr>
                            <td colspan="4">酒店信息</td>
                            <input type="hidden" id="id" name="id">
                            <input type="hidden" id="ipaddr" name="ipaddr">
                            <input type="hidden" id="hotelName" name="hotelName">

                        </tr>
                        </thead>
                        <tbody>
                        <tr class="ctt_gr">
                            <td width="244" align="right">酒店名：</td>
                            <td width="248" align="left" id="hotel2" name="hotel2"></td>
                            <td width="244" align="right">房间数：</td>
                            <td width="248" align="left" id="clientNo" name="clientNo"></td>
                        </tr>
                        <tr class="ctt_gr">
                            <td width="244" align="right">cpu：</td>
                            <td width="248" align="left" id="cpu" name="cpu">

                            </td>
                            <td width="244" align="right">更新时间：</td>
                            <td width="248" align="stime" id="stime" name="stime"></td>
                        </tr>
                        <tr class="ctt_gr">
                            <td width="244" align="right">链接：</td>
                            <td width="248" align="left"><input type="button" value="跳转" onclick="link()" class="layui-btn layui-btn-normal"/>
                            </td>

                        </tr>


                        <tr class="ctt_gr">
                            <td height="31" colspan="4" align="center">
                                <input name="submit22" type="button" value="关闭" border="0" onclick="document.getElementById
	('show').style.display='none'" class="layui-btn layui-btn-warm"/></td>
                        </tr>
                        </tbody>
                    </table>
                </div>






            </div>
        </div>
    </div>
</div>

<script>
    function sousuofangjian(){
        var sourname = $("#sourname").val();
        window.location.href='__APP__/admin/hinfo?rname='+sourname;
    }

    function link(){
        var id = $("#id").val();
        var ipaddr = $("#ipaddr").val();
        var hotelName = $("#hotelName").val();
        var urlHotel='http://'+ipaddr+'/'+hotelName+'/admin';
        //  alert(urlHotel);
//   top.location.href=urlHotel;
        window.open(urlHotel);
    }
    function showclick(val){
        var json=JSON.parse(val);
        var stime=json.stime;

        stime=new Date(parseInt(stime) * 1000).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " ");
        $("#id").val(json.id);
        $("#clientNo").html(json.clientNo);
        $("#hotelName").val(json.hotelName);
        $("#hotel2").html(json.hotel);
        $("#cpu").html(json.cpu);
        $("#stime").html(stime);
        $("#ipaddr").val(json.ipaddr);

        $("#show").show();
    }
    function quxiao0(){
        $("#show0").hide();
    }


    function expotrData(){
        var month=$("#soumonth").val();
        if(month){
            window.location.href='__APP__/admin/dataStatistics?month='+month;
        }else{
            alert("请选择要导出的月份");
        }
    }

</script>



